<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:replace="common/base::pagetitle"></title>
    <link th:replace="common/base::static"/>
    <link rel="stylesheet" th:href="@{/static/plugins/easyui/themes/material/easyui.css}">
    <link rel="stylesheet" th:href="@{/static/plugins/easyui/themes/icon.css}">
</head>
<body>
<div class="layui-form" style="padding: 20px 30px 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">银行名称</label>
        <div class="layui-input-inline">
            <input type="text" name="bankName" disabled="disabled" lay-verify="required" th:value="${dept!=null?dept.name:''}" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-inline">
            <input type="text" name="acctNo" lay-verify="required"  placeholder="请输入账号" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">账户名</label>
        <div class="layui-input-inline">
            <input type="text" name="acctName" lay-verify="required"  placeholder="请输入账户名" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">动账提醒平台方手机号</label>
        <div class="layui-input-inline">
            <input type="text" name="acctPhone" lay-verify="required"  placeholder="请输入动账提醒平台方手机号" autocomplete="off" class="layui-input">
        </div>
    </div>



    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit="" lay-filter="kFormSubmit" id="kFormSubmit" value="确认添加">
        <input type="hidden" name="compId" th:value="${compId}">
        <input type="hidden" name="bankId" th:value="${bankId}">
    </div>
</div>

<script th:replace="common/base::context"></script>
<script th:replace="common/base::mainjs"></script>
<script th:src="@{/static/plugins/easyui/easyloader.js}"></script>
<script type="text/javascript" th:inline="javascript">
    layui.use(['form'], function () {
        var templateIsType = false;
        var $ = layui.$, form = layui.form;


        //监听提交
        form.on('submit(kFormSubmit)', function (data) {
            var field = data.field; //获取提交的字段
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

            $.ajax({
                type: req.type.post,
                url: field.id ? api.orgAccount.orgAdoptAdd : api.orgAccount.orgAdoptAdd,
                data: field,
                async: false,
                success: function (r) {
                    if (r.code === req.status.ok) {
                        parent.parent.layui.table.reload('kContentTable'); //重载表格
                        parent.layer.close(index); //再执行关闭
                    } else {
                        wlbKit.errorMsg(r.msg);
                    }
                }
            });

        });




    })
    </script>
</body>
</html>
